package com.gdpa.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gdpa.entity.TenancyArea;
import com.gdpa.mapper.TenancyAreaMapper;
import com.gdpa.service.ITenancyAreaService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 租赁区域表 服务实现类
 * </p>
 *
 * @author zsr
 * @since 2018-12-19
 */
@Service
public class TenancyAreaServiceImpl extends ServiceImpl<TenancyAreaMapper, TenancyArea> implements ITenancyAreaService {
    @Autowired
    TenancyAreaMapper tenancyAreaMapper;

    //通过区域名字查找区域
    @Override
    public List<TenancyArea> getAreaBySearch(Page page, String search) {
        return tenancyAreaMapper.getAreaBySearch(page,search);
    }

    //根据ID删除区域
    @Override
    public boolean deleteAreaById(Integer id) {
        return tenancyAreaMapper.deleteAreaById(id);
    }

    @Override
    public List<String> getSameArea(Integer id) {
        return tenancyAreaMapper.getSameArea(id);
    }

    @Override
    public boolean updateAreaById(TenancyArea tenancyArea) {
        return tenancyAreaMapper.updateAreaById(tenancyArea);
    }

    @Override
    public boolean addArea(TenancyArea tenancyArea) {
        return tenancyAreaMapper.addArea(tenancyArea);
    }

    @Override
    public List<String> getArea() {
        return tenancyAreaMapper.getArea();
    }

    @Override
    public List<TenancyArea> getAreaList() {
        return tenancyAreaMapper.getAreaList();
    }
}
